﻿using MengLin.OOP.DesignPattern.Observer.IPhoneXPriceDown.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MengLin.OOP.DesignPattern.Observer.IPhoneXPriceDown
{
    class Program
    {
        static void Main(string[] args)
        {
            #region 框架搭建中的事件应用-标准事件-IPhoneX降价，果断买。
            {
                IPhoneX iPhoneX = new IPhoneX()
                {
                    IPhoneX_Id = "123456",
                    IPhoneX_Version = "国行",
                    IPhoneX_Price = 3999
                };
                //订阅者：把订阅者和发布者的事件关联起来
                iPhoneX.IPhoneXEventHandler += new Student().Buy;
                iPhoneX.IPhoneXEventHandler += new Boss().Buy;
                iPhoneX.IPhoneX_Price = 2999;
            }
            #endregion

            Console.ReadLine();
        }
    }
}
